Optimal. Leaf size=79 \[ \frac{a^2 (e x)^n}{e n}+\frac{2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\sin \left (c+d x^n\right )\right )}{d e n}+\frac{b^2 x^{-n} (e x)^n \tan \left (c+d x^n\right )}{d e n} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0901147, antiderivative size = 79, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.273, Rules used = {4208, 4204, 3773, 3770, 3767, 8} \[ \frac{a^2 (e x)^n}{e n}+\frac{2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\sin \left (c+d x^n\right )\right )}{d e n}+\frac{b^2 x^{-n} (e x)^n \tan \left (c+d x^n\right )}{d e n} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4208
Rule 4204
Rule 3773
Rule 3770
Rule 3767
Rule 8
Rubi steps
\begin{align*} \int (e x)^{-1+n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx &=\frac{\left (x^{-n} (e x)^n\right ) \int x^{-1+n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx}{e}\\ &=\frac{\left (x^{-n} (e x)^n\right ) \operatorname{Subst}\left (\int (a+b \sec (c+d x))^2 \, dx,x,x^n\right )}{e n}\\ &=\frac{a^2 (e x)^n}{e n}+\frac{\left (2 a b x^{-n} (e x)^n\right ) \operatorname{Subst}\left (\int \sec (c+d x) \, dx,x,x^n\right )}{e n}+\frac{\left (b^2 x^{-n} (e x)^n\right ) \operatorname{Subst}\left (\int \sec ^2(c+d x) \, dx,x,x^n\right )}{e n}\\ &=\frac{a^2 (e x)^n}{e n}+\frac{2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\sin \left (c+d x^n\right )\right )}{d e n}-\frac{\left (b^2 x^{-n} (e x)^n\right ) \operatorname{Subst}\left (\int 1 \, dx,x,-\tan \left (c+d x^n\right )\right )}{d e n}\\ &=\frac{a^2 (e x)^n}{e n}+\frac{2 a b x^{-n} (e x)^n \tanh ^{-1}\left (\sin \left (c+d x^n\right )\right )}{d e n}+\frac{b^2 x^{-n} (e x)^n \tan \left (c+d x^n\right )}{d e n}\\ \end{align*}
Mathematica [A] time = 0.365918, size = 54, normalized size = 0.68 \[ \frac{x^{-n} (e x)^n \left (a^2 d x^n+2 a b \tanh ^{-1}\left (\sin \left (c+d x^n\right )\right )+b^2 \tan \left (c+d x^n\right )\right )}{d e n} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 0.18, size = 276, normalized size = 3.5 \begin{align*}{\frac{{a}^{2}x}{n}{{\rm e}^{-{\frac{ \left ( -1+n \right ) \left ( i{\it csgn} \left ( ie \right ){\it csgn} \left ( ix \right ){\it csgn} \left ( iex \right ) \pi -i\pi \, \left ({\it csgn} \left ( iex \right ) \right ) ^{2}{\it csgn} \left ( ie \right ) -i\pi \, \left ({\it csgn} \left ( iex \right ) \right ) ^{2}{\it csgn} \left ( ix \right ) +i \left ({\it csgn} \left ( iex \right ) \right ) ^{3}\pi -2\,\ln \left ( x \right ) -2\,\ln \left ( e \right ) \right ) }{2}}}}}+{\frac{2\,ix{b}^{2}}{dn{x}^{n} \left ( 1+{{\rm e}^{2\,i \left ( c+d{x}^{n} \right ) }} \right ) }{{\rm e}^{-{\frac{ \left ( -1+n \right ) \left ( i{\it csgn} \left ( ie \right ){\it csgn} \left ( ix \right ){\it csgn} \left ( iex \right ) \pi -i\pi \, \left ({\it csgn} \left ( iex \right ) \right ) ^{2}{\it csgn} \left ( ie \right ) -i\pi \, \left ({\it csgn} \left ( iex \right ) \right ) ^{2}{\it csgn} \left ( ix \right ) +i \left ({\it csgn} \left ( iex \right ) \right ) ^{3}\pi -2\,\ln \left ( x \right ) -2\,\ln \left ( e \right ) \right ) }{2}}}}}-{\frac{4\,iab{e}^{n}\arctan \left ({{\rm e}^{i \left ( c+d{x}^{n} \right ) }} \right ){{\rm e}^{-{\frac{i}{2}}\pi \,{\it csgn} \left ( iex \right ) \left ( -1+n \right ) \left ( -{\it csgn} \left ( iex \right ) +{\it csgn} \left ( ix \right ) \right ) \left ( -{\it csgn} \left ( iex \right ) +{\it csgn} \left ( ie \right ) \right ) }}}{ned}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.77468, size = 271, normalized size = 3.43 \begin{align*} \frac{a^{2} d e^{n - 1} x^{n} \cos \left (d x^{n} + c\right ) + a b e^{n - 1} \cos \left (d x^{n} + c\right ) \log \left (\sin \left (d x^{n} + c\right ) + 1\right ) - a b e^{n - 1} \cos \left (d x^{n} + c\right ) \log \left (-\sin \left (d x^{n} + c\right ) + 1\right ) + b^{2} e^{n - 1} \sin \left (d x^{n} + c\right )}{d n \cos \left (d x^{n} + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \sec \left (d x^{n} + c\right ) + a\right )}^{2} \left (e x\right )^{n - 1}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]